package com.ktjy.service;

import com.ktjy.dao.UserDao;
import com.ktjy.dao.UserDaoImp;
import com.ktjy.pojo.Pet;
import com.ktjy.pojo.User;

public class UserServiceImp implements UserService {

    //UserDao userDao = new UserDaoImp();
    UserDao userDao;
    private int age;

    public void setAge(int age) {
        this.age = age;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public UserServiceImp(UserDao userDao, int age) {
        this.userDao = userDao;
        this.age = age;
    }

    public UserServiceImp(UserDao userDao) {
        this.userDao = userDao;
    }

    public UserServiceImp() {
    }

    @Override
    public int addUser(User user) {
        System.out.println("age:" + age);
        return userDao.add(user);
    }
}
